package day5;

import java.io.File;
import java.io.IOException;
import java.util.Date;

/**
 * @author oldliu
 * @since 1.0
 */
public class FileTest {
    public static void main(String[] args) throws IOException {
        System.out.println("分隔符:"+File.separator);
        //File f=new File("D:\\Documents\\桌面\\cpu-z_2.04-cn");
        File f=new File("D:/PyCharm 2021.2.3/lib");
        System.out.println("位置："+f.getParent());
        System.out.println("完整的位置："+f.getAbsolutePath());
        System.out.println("完整的位置："+f.getCanonicalPath());
        System.out.println("名字："+f.getName());
        System.out.println("存在？"+f.exists());
        System.out.println("是文件夹？"+f.isDirectory());
        System.out.println("是文件？"+f.isFile());
        System.out.println("能读？"+f.canRead());
        System.out.println("能写？"+f.canWrite());
        System.out.println("能执行？"+f.canExecute());
        System.out.println("大小:"+f.length()+"字节");
        System.out.println("最后修改时间:"+new Date(f.lastModified()));


    }
}
